﻿using System;
namespace WebTraderLiteCL
{
    public class Admin : User
    {

        //initializer
        DBTransactions DB = new DBTransactions();


        public Admin()
        {
            this.AccountStatus = "Admin";
            this.accBalance = 0F;
            this.AccountType = string.Empty;
            this.Email = string.Empty;
            this.FirstName = string.Empty;
            this.LastName = string.Empty;
            //this.RegistrationDate = string.Empty;
            this.UserAddress = string.Empty;
            this.zipcode = string.Empty;
            this.password = string.Empty;
        }//end default constructor

        public Admin(string userID)
        {
            this.UserID = userID;
            this.AccountStatus = DB.retrieveAccountStatus(userID);
            this.AccountType = DB.retrieveAccountType(userID);
            this.accBalance = DB.retrieveAccountBal(userID);
            this.Email = DB.retrieveEmail(userID);
            this.FirstName = DB.retrieveFirstName(userID);
            this.LastName = DB.retrieveLastName(userID);
            this.RegistrationDate = DB.retrieveRegistrationDate(userID);
            this.UserAddress = DB.retrieveUserAddress(userID);
            this.zipcode = DB.retrieveZipCode(userID);
            this.password = DB.retrievePswd(userID);
            DB.CloseDB();
        }

        //return 0 on success
        private int AcceptUser(GenUser user)
        {

            //would the email message .Net method be called here as well ??
            DB.AddNewUser(user);

            return 0;
        }//end AcceptUser

        //returns 0 on success
        private int ReactiveateUser(GenUser user)
        {

            //would the email message .Net method be called here as well ??
            DB.reactivateAccount(user.getUserID());

            return 0;
        }//end ReactiveateUser

        //return 0 on success
        private int SetBrokerFee(float fee)
        {

            DB.setBrokerFee(fee);

            return 0;
        }//end setBrokerFee

        //return 0 on success
        private int SuspendUser(GenUser user)
        {

            DB.suspendUser(user);

            return 0;
        }//end SuspendUser


    }//end Admin Class
}